package com.spark.core;

import java.io.File;
import java.util.List;

public class SparkTemplate{
	
	public static final String PROPERTITY_CACHE = "cache";
	
	public static final String PROPERTITY_CHECK_SESSION = "checkSession";
	
	private File file;
	
	private String xml;
	
	private boolean isCache = false;
	
	private boolean checkSession = false;
	
	private String name;
	
	private String filePath;
	
	private Long lastModified;
	
	private List<XMap> actions;
	
	public SparkTemplate(File file){
		setFile(file);
		String path = file.getAbsolutePath();
//		setName(DigestUtils.md5Hex(path));//1000次大概多50-60ms
		setName(path);
		setFilePath(path);
//		setLastModified(file.lastModified());
	}
	

	public File getFile() {
		return file;
	}

	public void setFile(File file) {
		this.file = file;
	}

	public boolean isCache() {
		return isCache;
	}
	
	public boolean checkSession(){
		return checkSession;
	}
	public void setCheckSession(boolean check){
		this.checkSession = check;
	}

	public void setCache(boolean isCache) {
		this.isCache = isCache;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Long getLastModified() {
		return lastModified;
	}

	public void setLastModified(Long lastModified) {
		this.lastModified = lastModified;
	}

	public String getFilePath() {
		return filePath;
	}

	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}

	public List<XMap> getActions() {
		return actions;
	}
	public void setActions(List<XMap> actions) {
		this.actions = actions;
	}
	
	
	public void setXML(String xml){
		this.xml = xml;
	}
	public String getXML(){
		return this.xml;
	}
}
